phrase = input()
brackets_open = "([{<"
brackets_close = ")]}>"
mystack = []
brackets_match = True
for char in phrase:
    if char in brackets_open:
        mystack.append(char)
    if char in brackets_close:
        if len(mysrack) == 0 or brackets_close.find(char)!= brackets_open.find(mystack.pop()):
            brackets_match = False
            break
        if len(mystack) == 0 and brackets_match:
            print("Верная")
        else:
            print("Неверная")
